home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trusted Irix /B 4.0.4
/
Trusted-Irix B-4.0.1.iso
/
dist
/
eoe1.idb
/
usr
/
include
/
sys
/
termio.h.z
/
termio.h
Wrap
C/C++ Source or Header
|
1992-04-03
|
7KB
|
289 lines
/* terminal I/O definitions
* some System V, some BSD.
*
* $Revision: 3.23 $
*/
#ifndef __TERMIO_H__
#define __TERMIO_H__
#define NCC 8
#define NCC_PAD 7 /* padding in case next version of SV extends NCC */
#define NCC_EXT 16 /* SGI extensions to SVR3 set */
#define NCCS (NCC+NCC_PAD+NCC_EXT)
/* control characters */
#define VINTR 0
#define VQUIT 1
#define VERASE 2
#define VKILL 3
#define VEOF 4
#define VEOL 5
#define VEOL2 6
#define VMIN VEOF
#define VTIME VEOL
#define VSWTCH 7
#define VLNEXT (NCC+NCC_PAD+0) /* take next character literally */
#define VWERASE (NCC+NCC_PAD+1) /* erase previous word (LDISC1) */
#define VRPRNT (NCC+NCC_PAD+2) /* retype the line (LDISC1) */
#define VFLUSHO (NCC+NCC_PAD+3) /* flush output (LDISC1) */
#define VSTOP (NCC+NCC_PAD+4) /* XOFF */
#define VSTART (NCC+NCC_PAD+5) /* XON */
#define CNUL 0
#define CDEL 0377
/* default control chars */
#define CTRL(c) ('c'&037)
#define CESC '\\' /* LDISC0 'literal next' default */
#define CINTR 0177 /* DEL */
#define CQUIT 034 /* FS, cntl-\ */
#define CBRK 0377 /* 4.3BSD compatibility */
#define CERASE CTRL(H)
#define CKILL CTRL(U)
#define CEOF CTRL(d)
#define CEOT CEOF /* 4.3BSD compatibility */
#define CSTART CTRL(q)
#define CSTOP CTRL(s)
#define CSWTCH CTRL(z)
#define CSUSP CSWTCH /* 4.3BSD job-control signal */
#define CNSWTCH 0 /* turn off control-Z */
/* LDISC1 default control chars */
#define CLNEXT CTRL(v)
#define CWERASE CTRL(w)
#define CFLUSHO CTRL(o)
#define CFLUSH CFLUSHO /* back compatibility */
#define CRPRNT CTRL(r)
#define CDSUSP CTRL(y) /* delayed job-control (not implemented yet) */
/* input modes */
#define IGNBRK 0000001
#define BRKINT 0000002
#define IGNPAR 0000004
#define PARMRK 0000010
#define INPCK 0000020
#define ISTRIP 0000040
#define INLCR 0000100
#define IGNCR 0000200
#define ICRNL 0000400
#define IUCLC 0001000
#define IXON 0002000
#define IXANY 0004000
#define IXOFF 0010000
#define IBLKMD 0020000
/* output modes */
#define OPOST 0000001
#define OLCUC 0000002
#define ONLCR 0000004
#define OCRNL 0000010
#define ONOCR 0000020
#define ONLRET 0000040
#define OFILL 0000100
#define OFDEL 0000200
#define NLDLY 0000400
#define NL0 0
#define NL1 0000400
#define CRDLY 0003000
#define CR0 0
#define CR1 0001000
#define CR2 0002000
#define CR3 0003000
#define TABDLY 0014000
#define TAB0 0
#define TAB1 0004000
#define TAB2 0010000
#define TAB3 0014000
#define BSDLY 0020000
#define BS0 0
#define BS1 0020000
#define VTDLY 0040000
#define VT0 0
#define VT1 0040000
#define FFDLY 0100000
#define FF0 0
#define FF1 0100000
/* control modes */
#define CBAUD 0000017
#define B0 0
#define B50 0000001 /* not supported */
#define B75 0000002
#define B110 0000003
#define B134 0000004
#define B150 0000005
#define B200 0000006 /* not supported */
#define B300 0000007
#define B600 0000010
#define B1200 0000011
#define B1800 0000012 /* not supported */
#define B2400 0000013
#define B4800 0000014
#define B9600 0000015
#define B19200 0000016
#define EXTA 0000016
#define B38400 0000017
#define EXTB 0000017
#define CSIZE 0000060
#define CS5 0
#define CS6 0000020
#define CS7 0000040
#define CS8 0000060
#define CSTOPB 0000100
#define CREAD 0000200
#define PARENB 0000400
#define PARODD 0001000
#define HUPCL 0002000
#define CLOCAL 0004000
#ifdef SVR3
/* #define RCV1EN 0010000 */
/* #define XMT1EN 0020000 */
#endif
#define LOBLK 0040000
/* line discipline 0 modes in lflag */
#define ISIG 0000001
#define ICANON 0000002
#define XCASE 0000004
#define ECHO 0000010
#define ECHOE 0000020
#define ECHOK 0000040
#define ECHONL 0000100
#define NOFLSH 0000200
#define IIEXTEN 0000400 /* !!!!!!NOT YET IMPLEMENTED!!!!!!! */
#define ITOSTOP 0001000
#define SSPEED B9600
#if defined SVR3 || !defined _KERNEL
# include <sys/ioctl.h>
#else
# include "../h/ioctl.h"
#endif
typedef unsigned short tcflag_t;
typedef unsigned char cc_t;
/*
* Ioctl control packet
* Note that this structure is identical with "struct termios"
* defined in <termios.h> - should there be need to change
* one or the other, the POSIX compatibility functions
* tcgetattr and tcsetattr (at least) will have to be
* changed.
*/
struct termio {
tcflag_t c_iflag; /* input modes */
tcflag_t c_oflag; /* output modes */
tcflag_t c_cflag; /* control modes */
tcflag_t c_lflag; /* line discipline modes */
char c_line; /* line discipline */
cc_t c_cc[NCCS]; /* control chars */
};
#define IOCTYPE 0xff00
#define TIOC ('T'<<8)
#define oTCGETA (TIOC|1) /* old versions */
#define oTCSETA (TIOC|2)
#define oTCSETAW (TIOC|3)
#define oTCSETAF (TIOC|4)
#define TCSBRK (TIOC|5)
#define TCXONC (TIOC|6)
#define TCFLSH (TIOC|7)
#define TCGETA (TIOC|8)
#define TCSETA (TIOC|9)
#define TCSETAW (TIOC|10)
#define TCSETAF (TIOC|11)
#define TIOCFLUSH (TIOC|12)
#ifdef TRUSTEDIRIX
#define TCSETLABEL (TIOC|13) /* set device label */
#endif /* TRUSTEDIRIX */
#define TCDSET (TIOC|32)
#define TCBLKMD (TIOC|33)
#define TIOCPKT (TIOC|112) /* pty: set/clear packet mode */
#define TIOCPKT_DATA 0x00 /* data packet */
#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */
#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */
/* not supported #define TIOCPKT_STOP 0x04 */ /* stop output */
/* not supported #define TIOCPKT_START 0x08 */ /* start output */
#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */
#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */
#define TIOCNOTTY (TIOC|113) /* disconnect from tty & pgrp */
#define TIOCSTI (TIOC|114) /* simulate terminal input */
#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */
#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */
#define TIOCCONS _IOW('t', 120, int) /* make this the console */
/*
* Window size structure
*/
struct winsize {
unsigned short ws_row, ws_col; /* character size of window */
unsigned short ws_xpixel, ws_ypixel; /* pixel size of window */
};
#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */
#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */
#define TFIOC ('F'<<8)
#define oFIONREAD (TFIOC|127) /* pre-3.5 value of FIONREAD */
#define LDIOC ('D'<<8)
#define LDOPEN (LDIOC|0)
#define LDCLOSE (LDIOC|1)
#define LDCHG (LDIOC|2)
#define LDGETT (LDIOC|8)
#define LDSETT (LDIOC|9)
/*
* Terminal types
*/
#define TERM_NONE 0 /* tty */
#define TERM_TEC 1 /* TEC Scope */
#define TERM_V61 2 /* DEC VT61 */
#define TERM_V10 3 /* DEC VT100 */
#define TERM_TEX 4 /* Tektronix 4023 */
#define TERM_D40 5 /* TTY Mod 40/1 */
#define TERM_H45 6 /* Hewlitt-Packard 45 */
#define TERM_D42 7 /* TTY Mod 40/2B */
/*
* Terminal flags
*/
#define TM_NONE 0000 /* use default flags */
#define TM_SNL 0001 /* special newline flag */
#define TM_ANL 0002 /* auto newline on column 80 */
#define TM_LCF 0004 /* last col of last row special */
#define TM_CECHO 0010 /* echo terminal cursor control */
#define TM_CINVIS 0020 /* do not send esc seq to user */
#define TM_SET 0200 /* must be on to set/res flags */
/*
* Line Disciplines
*/
#define LDISC0 0 /* ancient, standard */
#define LDISC1 1 /* new, 4.3BSD-like in streams */
#define NTTYDISC LDISC1 /* compatibility for BSD programs */
/*
* structure of ioctl arg for LDGETT and LDSETT
* This structure is no longer used.
*/
struct termcb {
char st_flgs; /* term flags */
char st_termt; /* term type */
char st_crow; /* gtty only - current row */
char st_ccol; /* gtty only - current col */
char st_vrow; /* variable row */
char st_lrow; /* last row */
};
#endif